﻿<script>
    $(function () {
        if ('@ViewBag.successMessage' != "") {
            alert('@ViewBag.successMessage');
            if ('@ViewBag.Url' != "")
                window.location = '@ViewBag.Url';
        }
        //else {
        //    $("#divSuccess-dialog").dialog("open");
        //    alert('hide!');
        //}

        if ('@ViewBag.FailureMessage' != "") {
            alert('@ViewBag.FailureMessage');
        }
        

        if ('@ViewBag.InfoMessage' != "") {
            alert('@ViewBag.InfoMessage');
           }


        @*        $('#divSuccess-dialog').dialog({
            autoOpen: false, width: 400, resizable: false, modal: true, //Dialog options
            buttons: {
                "OK": function () {
                    window.location = '@ViewBag.Url';
                        $(this).dialog("close");
                    }
                }
                //$(document).ready(function () {


                // });

            });*@

    });
</script>
@*<div id="divSuccess-dialog" title="Completed!">
    <p>@ViewBag.successMessage </p>
</div>*@

@*<div id="divError-dialog" title="Failure!">
    <p>@ViewBag.FailureMessage </p>
</div>*@